<template>
  <div class="index">
    <el-container class="container">
      <el-aside width="200px">
        <el-row>
          <el-col :span="24">
            <h3 class="logo"><router-link to='/'>小U商城后台</router-link></h3>
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              background-color="#545c64"
              text-color="#fff"
              active-text-color="#ffd04b"
            >
              <el-menu-item index="1" @click="change('index')">
                <i class="el-icon-menu"></i>
                <span slot="title">首页</span>
              </el-menu-item>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-location"></i>
                  <span>系统设置</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1" @click="change('menuList')">菜单管理</el-menu-item>
                  <el-menu-item index="1-2" @click="change('role')">角色管理</el-menu-item>
                  <el-menu-item index="1-3" @click="change('adminList')">管理员管理</el-menu-item>
                </el-menu-item-group>
              </el-submenu>
              <el-menu-item index="3">
                <i class="el-icon-menu"></i>
                <span slot="title">商城管理</span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <el-container>
        <el-header>Header</el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
      
    }
  },
  methods: {
    change(path) {
      this.$router.push('/index/'+path)
    }
  }
};
</script>
<style lang="">
.container {
  height: 100vh;
}
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.page-nav{
    height: 100vh;
    background-color: #262a32;
    overflow: hidden;
}
.page-nav .el-menu{
    border-right: 0;
}
.page-nav h3{
    line-height: 60px;
    text-align: center;
    font-size: 20px;
    color: #fff;
    background-color: #444;
    white-space: nowrap;
    overflow: hidden;
    font-weight: normal;
    letter-spacing: 3px;
}
</style>